<#assign packageModel=projPackage.entity valuePrefix="#{"
        serviceImplPackage=projPackage.projPackage+"."+projPackage.service
        serviceFullPackage="account.service." + tableInfo.modelClassName + "Service"
        daoPackageAndClass="account.dao."+tableInfo.modelClassName+"Mapper"
        modelPackageAndClass="account.entity."+tableInfo.modelClassName
        >
package account.service.impl;

import java.util.Optional;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.context.annotation.Lazy;
import ${daoPackageAndClass};
import ${modelPackageAndClass};
import ${serviceFullPackage};

/**
 * @Description : 服务层实现类，自定义代码写在最后，不要插在中间
 * @Author : chanchaw
 * @Date : ${.now?date} ${.now?time}
 */
@Service
public class ${tableInfo.modelClassName}ServiceImpl implements ${tableInfo.modelClassName}Service {
    @Autowired
    private ${tableInfo.modelClassName}Mapper dao;

    @Override
    @Transactional
    public ${tableInfo.modelClassName} insert(${tableInfo.modelClassName} record) {
        dao.insert(record);
        return record;
    }

    @Override
    @Transactional
    public ${tableInfo.modelClassName} insertSelective(${tableInfo.modelClassName} record) {
        dao.insertSelective(record);
        return record;
    }

    @Override
    @Transactional(rollbackFor = Exception.class)
    public List<${tableInfo.modelClassName}> multiInsert(List<${tableInfo.modelClassName}> list) {
        list.forEach(item -> insertSelective(item));
        return list;
    }

    @Override
    public int updateByPrimaryKey(${tableInfo.modelClassName} record) {
        return dao.updateByPrimaryKey(record);
    }

    @Override
    public int updateByPrimaryKeySelective(${tableInfo.modelClassName} record) {
        return dao.updateByPrimaryKeySelective(record);
    }

    <#list tableInfo.fieldInfoList as field>
    <#if field.primaryKey=true>
    @Override
    public int deleteByPrimaryKey(${field.javaType} ${field.fieldName}) {
        return dao.deleteByPrimaryKey(${field.fieldName});
    }

    @Override
    public ${tableInfo.modelClassName} selectByPrimaryKey(${field.javaType} ${field.fieldName}) {
        return dao.selectByPrimaryKey(${field.fieldName});
    }
    </#if>
    </#list>

    @Override
    public List<${tableInfo.modelClassName}> selectAll(){
        return dao.selectAll();
    }
    //=================以上是自动生成的代码，自定义代码请写在下面==================
}